<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	            xmlns:ui="http://java.sun.com/jsf/facelets"
	            xmlns:h="http://java.sun.com/jsf/html"
	            xmlns:f="http://java.sun.com/jsf/core"
	            xmlns:rich="http://richfaces.org/rich"
	            xmlns:a4j="http://richfaces.org/a4j"
	            template="/WEB-INF/layout/template.xhtml">

	<ui:define name="title">
		<h:outputText value="#{i18n['warenkorb.title']}" />
	</ui:define>

	<ui:define name="contents">
		<h:outputText value="#{i18n['warenkorb.empty']}"
		              rendered="#{empty bv.warenkorb}"/>

		<h1><h:outputText value="#{i18n['warenkorb.heading']}"
		                  rendered="#{not empty bv.warenkorb}"/></h1>

		<h:form id="anzahlForm" rendered="#{not empty bv.warenkorb}">
			<rich:dataTable id="warenkorb"
			                value="#{bv.warenkorb}"
			                var="bp"
			                cellspacing="10">
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{i18n['warenkorb.artikel.id']}"/>
					</f:facet>
					<h:outputText value="#{bp.artikel.id}"/>
				</rich:column>
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{i18n['warenkorb.artikel.bezeichnung']}"/>
					</f:facet>
					<h:outputText value="#{bp.artikel.bezeichnung}"/>
				</rich:column>
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{i18n['warenkorb.artikel.anzahl']}"/>
					</f:facet>
					<h:inputText value="#{bp.anzahl}" size="3">
						<f:converter converterId="javax.faces.Short"/>
						<f:validateLongRange minimum="0"/>
					</h:inputText>
				</rich:column>
			</rich:dataTable>				
			<p>
				<h:commandButton action="#{bv.updateWarenkorb}"
					             value="#{i18n['warenkorb.bestellen']}" />
			</p>
		</h:form>
	</ui:define>
</ui:composition>
